SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE dbo.[DnnProduct_CDS_CategoriesCountWithoutNoCategory]
	@DistributorID varchar(50)
AS
BEGIN
	SELECT count([ID])
	FROM DnnProduct_CDS_Categories
	WHERE DistributorID = @DistributorID AND NOT (ParentID IS NULL AND [Name] = 'No Category Assigned' AND [IsReadOnly] = 1)
END
GO
